home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 60.zip
/
BS1 part 60
/
Crossdos v5.7.adf
/
Install
< prev
next >
Wrap
Text File
|
1993-06-07
|
35KB
|
1,577 lines
;********************************************************************
;Installation script for CrossDOS 5+ (including CrossPC)
;********************************************************************
;$VER: Install 5.06 (7.6.93)
;Bugs in Installer V1.22:
;1. The "run" command does not accept a relative path.
;2. The tooltype delete feature is case-sensitive.
;mycopylib is used because of installer limitations. It uses the following global
;strings as input:
;mysource - source
;mydest - destination
;mynewname - new name
(procedure mycopylib
(
(set errorflag 0)
;form destination file
(set destfile
(tackon mydest mynewname)
)
(if
(= 0
(exists destfile)
)
(
(copyfiles
(source mysource)
(dest mydest)
(newname mynewname)
)
(set errorflag 1)
)
(
;the destfile exists, so we must check the versions
(if
(exists mysource)
(
(set sourcevernum (getversion mysource))
(set sourcever (/ sourcevernum 65536))
(set sourcerev (- sourcevernum (* sourcever 65536)))
(set destvernum (getversion destfile))
(set destver (/ destvernum 65536))
(set destrev (- destvernum (* destver 65536)))
(if
(or
(or
(not ks20)
(> sourcever destver)
)
(
(and
(= sourcever destver)
(>= sourcerev destrev)
)
)
)
(
(copyfiles
(source mysource)
(dest mydest)
(newname mynewname)
)
(set errorflag 1)
)
)
)
)
)
)
(if
(= errorflag 0)
(
;Handle a version conflict
(if
(= @user-level 2)
(
(if
(askbool
(prompt (cat "The version of \"" mynewname)
"\" currently on your system appears to be "
"newer than the CrossDOS version. Select \"Skip\" to "
"preserve the version currently on your system, "
"or \"Overwrite\" to install the CrossDOS version "
"regardless."
)
(choices "Overwrite"
"Skip"
)
(help "This message should only appear if you are "
"running Workbench 2.1 or later. If you are not, "
"select Overwrite to copy the CrossDOS file anyway."
)
)
(
(copyfiles
(source mysource)
(dest mydest)
(newname mynewname)
)
(set errorflag 1)
)
)
)
)
)
)
)
)
(procedure InstallTDPatch
(
;Install TDPatch12/TDPatch13
(if
(< ksver 35)
(
(if
(= ksver 33)
(
(set patch "TDPatch12 >nil:")
(copyfiles
(source ":c/TDPatch12")
(dest "c:")
)
)
(
(set patch "TDPatch13 >nil:")
(copyfiles
(source ":c/TDPatch13")
(dest "c:")
)
)
)
(if
(= @user-level 2)
(message "You are running Kickstart 1.2 or 1.3. "
"A special patch utility called TDPatch12/"
"TDPatch13 is REQUIRED for CrossDOS/CrossPC to function "
"on your system. This file was copied to "
"your C: directory."
)
)
)
)
)
)
;SetHD -- place hard drive information (e.g. C=PCC) in the CrossPC tooltypes
;harddisk -- e.g. PCC
;pcdir -- directory of CrossPC icon
(procedure SetHD
(
;If the user has configured a hard drive during this session,
;add an appropriate tooltype.
(if
(not
(= harddisk "")
)
(
;Grab the last character of harddisk and place it in hdchar
(set hdchar
(substr harddisk
(-
(strlen harddisk)
1
)
1
)
)
(if
(not
(exists
(tackon pcdir "CrossPC.info")
)
)
(message "Warning: Can't find CrossPC's icon. CrossPC will not be configured.")
)
(tooltype
(dest (tackon pcdir "CrossPC"))
(settooltype hdchar harddisk)
)
)
)
)
)
;MountHD -- mount the thing
;harddisk -- e.g. PCC
(procedure MountHD
(
;If the user has configured a hard drive during this session,
;mount etc.
(if
(not
(= harddisk "")
)
(
;Mount the hard drive the user just configured.
(run
(cat @execute-dir
(cat "c/mount >nil: devs:DOSDrivers/" harddisk)
)
)
)
)
)
)
;********************** CrossDOS UNinstallation **************************
;Enter with "deletedirstr" set to the name of the directory to terminate
;and deletepat with the amigados wildcards.
(procedure deletedir
(
(if
(= 2
(exists deletedirstr)
)
(
(foreach deletedirstr deletepat
(delete
(tackon deletedirstr @each-name)
)
)
(delete
(tackon deletedirstr ".info")
)
(delete deletedirstr)
(delete
(cat deletedirstr ".info")
)
)
)
)
)
(procedure DeleteOldCD
(
;misc
(delete "sys:wbstartup/mountmf")
(delete "sys:wbstartup/mountmf.info")
;sys:system
(delete "sys:system/diskchg")
(delete "sys:system/diskchk")
(delete "sys:system/IntlTrans")
(delete "sys:system/kill")
(delete "sys:system/mdiskcopy")
(delete "sys:system/mformat")
(delete "sys:system/txfilter")
(delete "sys:system/diskchg.info")
(delete "sys:system/diskchk.info")
(delete "sys:system/IntlTrans.info")
(delete "sys:system/kill.info")
(delete "sys:system/mdiskcopy.info")
(delete "sys:system/mformat.info")
(delete "sys:system/txfilter.info")
(delete "sys:system/Atari_S9.MFormat.info")
(delete "sys:system/Atari_D9.MFormat.info")
(delete "sys:system/MSDOS_D9.MFormat.info")
(delete "sys:system/MSDOS_S9.MFormat.info")
(delete "sys:system/MSDOS_QD9.MFormat.info")
(delete "sys:system/MSDOS_Q18.MFormat.info")
(delete "sys:system/DiskChg.di0.info")
(delete "sys:system/DiskChg.di1.info")
(delete "sys:system/DiskChg.di2.info")
(delete "sys:system/DiskChg.di3.info")
(delete "sys:system/Kill.di0.info")
(delete "sys:system/Kill.di1.info")
(delete "sys:system/Kill.di2.info")
(delete "sys:system/Kill.di3.info")
(delete "sys:system/TxFilter.di0.info")
(delete "sys:system/TxFilter.di1.info")
(delete "sys:system/TxFilter.di2.info")
(delete "sys:system/TxFilter.di3.info")
;sys:crossdos
(delete "sys:crossdos/diskchg")
(delete "sys:crossdos/diskchk")
(delete "sys:crossdos/IntlTrans")
(delete "sys:crossdos/kill")
(delete "sys:crossdos/mdiskcopy")
(delete "sys:crossdos/mformat")
(delete "sys:crossdos/txfilter")
(delete "sys:crossdos/diskchg.info")
(delete "sys:crossdos/diskchk.info")
(delete "sys:crossdos/IntlTrans.info")
(delete "sys:crossdos/kill.info")
(delete "sys:crossdos/mdiskcopy.info")
(delete "sys:crossdos/mformat.info")
(delete "sys:crossdos/txfilter.info")
(delete "sys:crossdos/Atari_S9.MFormat.info")
(delete "sys:crossdos/Atari_D9.MFormat.info")
(delete "sys:crossdos/MSDOS_D9.MFormat.info")
(delete "sys:crossdos/MSDOS_S9.MFormat.info")
(delete "sys:crossdos/MSDOS_QD9.MFormat.info")
(delete "sys:crossdos/MSDOS_Q18.MFormat.info")
(delete "sys:crossdos/DiskChg.di0.info")
(delete "sys:crossdos/DiskChg.di1.info")
(delete "sys:crossdos/DiskChg.di2.info")
(delete "sys:crossdos/DiskChg.di3.info")
(delete "sys:crossdos/Kill.di0.info")
(delete "sys:crossdos/Kill.di1.info")
(delete "sys:crossdos/Kill.di2.info")
(delete "sys:crossdos/Kill.di3.info")
(delete "sys:crossdos/TxFilter.di0.info")
(delete "sys:crossdos/TxFilter.di1.info")
(delete "sys:crossdos/TxFilter.di2.info")
(delete "sys:crossdos/TxFilter.di3.info")
(delete "sys:crossdos/.info")
(delete "sys:crossdos")
(if
(not
(exists "sys:crossdos")
)
(delete "sys:crossdos.info")
)
)
)
(procedure UnInstallCrossDOS
(
(if
(askbool
(prompt "About to UNinstall CrossDOS: This function will try to "
"remove CrossDOS completely from your system. CrossPC will not "
"be removed, but it will cease to function properly. If you wish to "
"remove CrossPC, simply delete the \"CrossPC\" file from Workbench "
"or the CLI at any time.\n\n"
"Are you sure you want to uninstall CrossDOS?"
)
(help "This function will try to remove CrossDOS from your system "
"to the extent that it is possible to do so safely. Some parts "
"of CrossDOS \(such as replacement Mount, Format, and Diskcopy "
"commands\) will not be removed, because doing so might "
"disrupt the normal functioning of the system. Only in very "
"extreme cases should you find it neccessary to revert to the "
"to the original \(Commodore-supplied\) commands."
)
)
(
(DeleteOldCD)
(delete "l:MSDOSFileSystem")
(delete "l:CrossDOSFileSystem")
(delete "devs:mfm.device")
(delete "c:TDPatch12")
(delete "c:TDPatch13")
(delete "sys:system/CDFormat")
(delete "sys:system/CDFormat.info")
(delete "sys:system/CDDiskcopy")
(delete "sys:system/CDDiskcopy.info")
(delete "sys:system/CrossDOS")
(delete "sys:system/CrossDOS.info")
(delete "sys:system/DiskChg")
(delete "sys:system/DiskChg.info")
(delete "devs:dosdrivers/pc0")
(delete "devs:dosdrivers/pc1")
(delete "devs:dosdrivers/pc2")
(delete "devs:dosdrivers/pc3")
(delete "devs:dosdrivers/pc0.info")
(delete "devs:dosdrivers/pc1.info")
(delete "devs:dosdrivers/pc2.info")
(delete "devs:dosdrivers/pc3.info")
(set deletedirstr "sys:system/alt_formats")
(set deletepat "#?")
(deletedir)
(set deletedirstr "l:FileSystem_Trans")
(set deletepat "#?.crossdos")
(deletedir)
;Comment-out the main mount command from the user-startup
(if
(exists "s:user-startup")
(
(startup "CrossDOSV5+ - automatically mount all devices"
(help "This procedure only affects the main mount command placed "
"in the user-startup by the CrossDOS installation. After uninstallation, "
"the command will still be present in exactly the same form, "
"but it will be preceded by a \";\" character, thereby nullifying its "
"effects."
)
(prompt
(cat "This step will disable the CrossDOS "
(cat prefix
"Mount commmand in the "
"user-startup that normally mounts all devices in the "
"devs:DOSDrivers directory. (Other mount statements are unaffected). "
"If you wish to preserve this "
"functionality, you may choose to skip this part."
)
)
)
(command (cat ";" (cat prefix "Mount >nil: devs:DOSDrivers/~(#?.info)")))
)
)
)
(message "Finished UnInstalling CrossDOS. If you have manually moved "
"parts of CrossDOS from their normal location, those files "
"are still on your disk."
)
)
)
)
)
;********************** CrossDOS installation **************************
(procedure ModifyStartup
(
(startup "CrossDOSV5+ - automatically mount all devices"
(prompt "About to install a command in s:user-startup to automatically "
"start CrossDOS when you boot your system..."
)
(help "Normally you want CrossDOS to be automatically invoked every "
"time you start your system."
)
(command (cat prefix "Mount >nil: devs:DOSDrivers/~(#?.info)"))
)
)
)
(procedure InstallCrossDOS
(
(message "About to install CrossDOS...")
;Delete an old installation of CrossDOS
(if
(exists "l:msdosfilesystem")
(set old 1) ;if old
(set old 0) ;if not old
)
(if old
(
(message "About to delete a previous CrossDOS installation...")
(DeleteOldCD)
)
)
;Replace old MountMF command
(if
(exists "sys:mountmf")
(copyfiles
(source ":c/MountMF")
(dest "sys:")
)
)
(if
(exists "sys:crossdos/mountmf")
(copyfiles
(source ":c/MountMF")
(dest "sys:CrossDOS")
)
)
(if
(exists "c:mountmf")
(copyfiles
(source ":c/MountMF")
(dest "c:")
)
)
;Replace CDMount
(if
(exists "c:CDMount")
(copyfiles
(source (cat ":c/Mount" postfix))
(dest "c:")
(newname "CDMount")
)
)
;Create certain directories if they don't exist
(makedir "l:FileSystem_Trans"
(infos)
)
(makedir "sys:system"
(infos)
)
;The purpose of this is to create an icon for the devs: directory
;if needed.
(makedir
(getassign "devs")
(infos)
)
(makedir "devs:DOSDrivers"
(infos)
)
(if ks20
(
(set postfix ".2")
;Try to delete some 1.3 crust
(delete "c:TDPatch12")
(delete "c:TDPatch13")
)
(set postfix "")
)
;Put up menu asking about diskcopy/format/mount
(set utilopt 0)
(if @user-level
(set utilopt
(askchoice
(prompt "CrossDOS is supplied with greatly enhanced DiskCopy, Format "
"and Mount commands. We recommend replacing the existing commands "
"to allow greater functionality. "
"Please select an "
"option:"
)
(choices "Replace existing commands"
"Rename to CDDiskCopy, CDFormat, CDMount"
)
(help "Most users will want to replace their old commands with "
"the enhanced commands, because the old commands offer "
"no advantage. If you are fond of the old commands you may "
"choose to install the commands with a different name, starting with "
"CD (Cross Dos). Note that the replace option will NOT "
"overwrite your commands if you have a newer version "
"than we supply."
)
)
)
)
(if
(= utilopt 0)
(
(set prefix "")
;Try to delete CDDiskcopy and CDFormat
(delete "sys:system/CDFormat")
(delete "sys:system/CDFormat.info")
(delete "sys:system/CDDiskcopy")
(delete "sys:system/CDDiskcopy.info")
)
)
(if
(= utilopt 1)
(set prefix "CD")
)
(InstallTDPatch)
;Install mfm.device
(copyfiles
(source ":devs/mfm.device")
(dest "devs:")
)
;Install Mount command
(set mysource (cat ":c/Mount" postfix))
(set mydest "c:")
(set mynewname (cat prefix "Mount"))
(mycopylib)
;Install CrossDOSFileSystem
(copyfiles
(source (cat ":l/CrossDOSFileSystem" postfix))
(dest "l:")
(newname "CrossDOSFileSystem")
)
(if old
(copyfiles
(source (cat ":l/CrossDOSFileSystem" postfix))
(dest "l:")
(newname "MSDOSFileSystem")
)
)
;Copy devs:dosdrivers
(foreach ":" "PC?"
(
(copyfiles
(source
(cat ":" @each-name)
)
(dest "devs:DOSDrivers")
)
(copyfiles
(source
(cat ":"
(cat @each-name ".info")
)
)
(dest "devs:DOSDrivers")
)
(tooltype
(dest
(cat "devs:DOSDrivers/" @each-name)
)
(noposition)
(setdefaulttool
(cat
(cat "c:" prefix)
("Mount")
)
)
;Delete the "filesystem=" entry
;Case-sensitive!!! (yet another installer bug)
(settooltype "FILESYSTEM")
)
)
)
;Install gadtools13.library if running under 1.3.
(if
(not ks20)
(
(copyfiles
(source ":libs/gadtools13.library")
(dest "libs:")
)
)
)
;Ask the user whether he has a floptical
(set floptical
(askbool
(prompt "Do you have a Floptical drive?")
(help "If you aren't sure whether you have a Floptical, "
"you don't have one."
)
)
)
;Install Format
(if floptical
(
(copyfiles
(source ":system/Format")
(dest "sys:system")
(newname (cat prefix "Format"))
)
)
(
(set mysource (cat ":system/Format" postfix))
(set mydest "sys:system")
(set mynewname (cat prefix "Format"))
(mycopylib)
)
)
(if errorflag
(
(copyfiles
(source ":system/Format.info")
(dest "sys:system")
(newname (cat prefix "Format.info"))
)
(tooltype
(dest "sys:system/Format")
(noposition)
)
)
)
;Install alternate format icons (if floptical user)
(set deletedirstr "sys:system/alt_formats")
(set deletepat "#?")
(deletedir)
(if floptical
(
(makedir "sys:system/Alt_Formats"
(infos)
)
(foreach ":system/Alt_Formats" "#?.Format.info"
(
(copyfiles
(source
(cat ":system/Alt_Formats/" @each-name)
)
(dest "sys:system/Alt_Formats")
)
;Create a version of @each-name without the .info
(set infoname
(substr @each-name 0
(-
(strlen @each-name)
5
)
)
)
(tooltype
(dest
(cat "sys:system/Alt_Formats/" infoname)
)
(noposition)
(setdefaulttool
(cat
(cat "sys:system/" prefix)
("Format")
)
)
)
)
)
)
)
;Install DiskCopy
(set mysource (cat ":system/DiskCopy" postfix))
(set mydest "sys:system")
(set mynewname (cat prefix "DiskCopy"))
(mycopylib)
(if errorflag
(
(copyfiles
(source ":system/DiskCopy.info")
(dest "sys:system")
(newname (cat prefix "DiskCopy.info"))
)
(tooltype
(dest "sys:system/DiskCopy")
(noposition)
)
)
)
;Install the CrossDOS utility
(copyfiles
(source (cat ":system/CrossDOS" postfix))
(dest "sys:system")
(newname "CrossDOS")
)
(copyfiles
(source ":system/CrossDOS.info")
(dest "sys:system")
)
(tooltype
(dest "sys:system/CrossDOS")
(noposition)
)
;Copy FileSystem_Trans
(copyfiles
(source ":l/FileSystem_Trans")
(dest "l:FileSystem_Trans")
(all)
)
;Last copy operation -- copy DiskChg to sys:system
(copyfiles
(source ":system/DiskChg")
(dest "sys:system")
(infos) ;required!!!
)
(tooltype
(dest "sys:system/DiskChg")
(noposition)
)
;Enter mount command in s:user-startup. Previously we did this whenever
;installing on a new CD user's system. Now we don't care whether he has
;an old CD, but we do avoid inserting it into the u-s if the user is
;running Workbench 2.1 or higher, unless we are in expert mode and
;the user overrides our wisdom.
(if
(and
(= @user-level 2)
wb21
)
(
(if
(askbool
(prompt "If you select \"Install\", a command will be "
"inserted into your s:user-startup file to mount "
"all devices in the DOSDrivers drawer. Since you are "
"running Workbench 2.1 or above, however, this command should "
"already be there, unless you have extensively customized your "
"system. Select \"Skip\" to avoid adding a "
"redundant command \(which won't hurt, but will slow down "
"booting\)."
)
(choices "Install" "Skip")
(help "In most cases you should select \"Skip\".")
)
(
(user 0)
(ModifyStartup)
(user 2)
)
)
)
(
(if
(not wb21)
(ModifyStartup)
)
)
)
;Mount the stuff now so the user can use it immediately
;This 'run' is safe because c: is an explicit path
(run
(cat
(cat "c:" prefix)
("Mount >nil: devs:DOSDrivers/~(#?.info)")
)
)
(message "CrossDOS is now installed.")
)
)
;********************** CrossPC installation **************************
(procedure InstallCrossPC
(
(if
(not
(exists ":CrossPC")
)
(
(message "This copy of CrossDOS does not include CrossPC. Exiting...")
(exit
(quiet)
)
)
)
(message "About to install CrossPC...")
(if
(= 0
(exists "l:CrossDOSFileSystem")
)
(
(message "Note: CrossDOS V5 is not currently installed. It is "
"STRONGLY suggested that you install CrossDOS before "
"attempting to use CrossPC - or, if you prefer, invoke "
"CrossDOS directly from the product disk."
)
(InstallTDPatch)
(copyfiles
(source ":devs/mfm.device")
(dest "devs:")
)
)
)
(set pcdir
(askdir
(prompt "Please select a drawer in which to install "
"CrossPC"
)
(help "CrossPC is not picky about where you put it. Choose "
"any drive/drawer. Use the \"Make New Drawer\" option "
"to create a new drawer, if desired."
)
(default "sys:")
)
)
(copyfiles
(source ":CrossPC")
(dest pcdir)
)
;Copy the CrossPC.info file from the product disk UNLESS one already
;exists in the destination directory.
(if
(not
(exists
(tackon pcdir "CrossPC.info")
)
)
(
(copyfiles
(source ":CrossPC.info")
(dest pcdir)
)
(tooltype
(dest
(tackon pcdir "CrossPC")
)
(noposition)
)
)
)
;Set memory size tooltype for CrossPC
(set memopt
(askchoice
(prompt "Select a default IBM memory size. (You may change it later "
"by using the Info facility of Workbench)."
)
(help "If you have a reasonable amount of Amiga memory (3MB+) we "
"recommend the 704K setting to maximize the ability "
"of CrossPC. (NOTE: CrossPC does NOT support expanded or extended "
"memory). However, if maximum compatibility is your primary "
"concern, choose the 640K setting; a few (very few!) programs "
"don't run with 704K of memory."
)
(choices "256K - recommended for 1MB systems"
"384K"
"512K"
"640K - most compatible setting"
"704K - recommended for 3MB+ systems"
)
)
)
(if
(= memopt 0)
(set memtool "256")
)
(if
(= memopt 1)
(set memtool "384")
)
(if
(= memopt 2)
(set memtool "512")
)
(if
(= memopt 3)
(set memtool "640")
)
(if
(= memopt 4)
(set memtool "704")
)
(tooltype
(dest (tackon pcdir "CrossPC"))
(settooltype "MEM1" memtool)
)
;Check whether the user has a DF1:. If so, place B=PC1 in the
;CrossPC tooltypes.
(if
(not
(= ""
(getassign "df1" "d")
)
)
(
(tooltype
(dest (tackon pcdir "CrossPC"))
(settooltype "B" "PC1")
)
)
)
;Check whether the user has a DF2: but no DF1:. In that case,
;modify the "b=" tooltype.
(if
(= ""
(getassign "df1" "d")
)
(
(if
(not
(= ""
(getassign "df2" "d")
)
)
(
(tooltype
(dest (tackon pcdir "CrossPC"))
(settooltype "B" "PC2")
)
)
)
)
)
(message "CrossPC is now installed.")
)
)
;********************** Configure Hard Disk **************************
(procedure ConfigureHardDisk
(
(if
(= 0
(exists "l:CrossDOSFileSystem")
)
(
(message "CrossDOS 5 is not currently installed. It must "
"be installed before you can configure a hard drive. "
"Switching to CrossDOS installation..."
)
(InstallCrossDOS)
)
)
(set opt
(askchoice
(choices "Configure on an Amiga Partition"
"Configure a 100% MS-DOS Hard Disk"
)
(prompt "Please select an option. * Hit HELP for details!!! *")
(help "If you wish to create a simulated MS-DOS hard drive "
"on one of your Amiga hard drive partitions (note: "
"the MS-DOS information will completely wipe out any Amiga "
"files on that partition) select \"Configure on an Amiga "
"Partition\". If you want to dedicate an entire PHYSICAL "
"hard drive (or Syquest or Floptical or...) to storing "
"MS-DOS information, select \"Configure a 100% MS-DOS Hard "
"Disk\"."
)
)
)
;Ask for drive prefix
(set driveprefix
(askstring
(default "PC")
(prompt "Please enter a prefix to be assigned to the MS-DOS "
"device you wish to configure. A 'C' will be added "
"to the end of the device name for you. Please choose "
"a device name that is not already in use. "
"\nPress HELP for details."
)
(help "You must enter a prefix (which may be any normal "
"text, without spaces or any special characters) which will "
"be used to access the MS-DOS drive/partition from AmigaDOS. "
"A letter of 'C' will be "
"added by the configuration utility "
"to form the complete drive name, as accessed from AmigaDOS. "
"The relationship between the AmigaDOS drive name and the "
"MS-DOS drive name (accessed by CrossPC or by a real IBM) is very "
"simple. The last letter of the AmigaDOS name is the MS-DOS name. "
"For example, PCC: refers to MS-DOS drive C:. The prefix to "
"enter now would be PC (the default)."
)
)
)
;Create a temporary directory
(makedir "ram:CrossDOSTemp")
(set MountListDir "ram:CrossDOSTemp")
(makedir MountListDir)
;Run the ConfigDev program
(if
(= opt 0)
(set drivetype "AMIGA")
(set drivetype "MSDOS")
)
(set runargs
(cat
(drivetype)
(" -fL:CrossDOSFileSystem")
)
)
(set runargs
(cat
(runargs)
(cat
(" -t")
(MountListDir)
)
)
)
(set runargs
(cat
(runargs)
(cat
(" -p")
(driveprefix)
)
)
)
(run
(cat
(cat @execute-dir "c/ConfigDisk ")
runargs
)
)
;The purpose of this is to create an icon for the devs: directory
;if needed.
(makedir
(getassign "devs")
(infos)
)
(makedir "devs:DOSDrivers"
(infos)
)
;Create icons for the files in MountListDir and copy to DEVS:DOSDrivers
(set success 0)
(foreach MountListDir "#?"
(
(set success 1)
(set okflag 1)
;Check for "floptical" - ignore
(if
(= @each-name "floptical")
(set okflag 0)
)
;Check whether the user already has a mountfile of the same name
(if okflag
(if
(exists
(cat
("devs:DOSDrivers/")
(@each-name)
)
)
(
(set okflag
(askbool
(prompt "A file called \"" @each-name
"\" already exists in your DEVS:DOSDrivers "
"directory."
)
(choices "Overwrite"
"Cancel"
)
(help "You may elect to overwrite the mountfile "
"that currently exists, or abort the whole "
"procedure."
)
)
)
)
)
)
(if okflag
(
(copyfiles
(source
(cat
(cat
(MountListDir)
("/")
)
(@each-name)
)
)
(dest "devs:DOSDrivers")
(infos) ;just in case the DOSDrivers directory needs to be created.
)
(copyfiles
(source ":PC0.info")
(dest "devs:DOSDrivers")
(newname (cat @each-name ".info"))
)
(tooltype
(dest
(cat
("devs:DOSDrivers/")
(@each-name)
)
)
(noposition)
(setdefaulttool
(cat
(cat "c:" prefix)
("Mount")
)
)
;Delete the "filesystem=" entry
;Case-sensitive!!! (yet another installer bug)
(settooltype "FILESYSTEM")
)
(set harddisk @each-name)
)
)
)
)
;Delete the file created by ConfigDisk
(if success
(
(delete "ram:CrossDOSTemp/floptical")
(delete
(cat
("ram:CrossDOSTemp/")
(harddisk)
)
)
;Check whether the user selected "Install CrossPC". If not,
;ask whether he wants to add this drive to CrossPC's tooltypes etc.
(if
(in mainopt 1)
(
(MountHD)
(SetHD)
)
(
(MountHD)
(if
(or
(= 1
(exists "sys:CrossPC")
)
(= 1
(exists "sys:CrossPC/CrossPC")
)
)
(
(if
;File?
(= 1
(exists "sys:CrossPC")
)
(
(set pcdir "sys:")
(SetHD)
)
(
(set pcdir "sys:CrossPC")
(SetHD)
)
)
)
(
;Ask the user whether he wants to set the CrossPC tooltype
(if
(askbool
(prompt "If you have already installed CrossPC *and* "
"you wish to make the hard drive you configured "
"accessible to CrossPC, select \"Yes\"."
)
(help "If you select \"yes\", the installer will ask you "
"where CrossPC has been installed. The installer "
"will proceed to add a tooltype to the CrossPC icon."
)
)
(
(set notok 1)
(while notok
(
(set pcdir
(askdir
(prompt "Select the directory in which you "
"installed CrossPC."
)
(help "The installer will proceed to add a tooltype "
"to the CrossPC icon."
)
(default "sys:")
)
)
(if
(= 1
(exists
(tackon pcdir "CrossPC")
)
)
(
(SetHD)
(set notok 0)
)
(
(message "CrossPC is not in the directory you selected.")
)
)
)
)
)
)
)
)
)
)
(if success
(message "Hard drive configuration is completed."
"\n\n############ WARNING!!! ############"
"\nDO NOT use our Format command or the Amiga format command "
"to format " harddisk ":. Instead, you must treat the "
"hard disk you just configured as an unpartitioned, unformatted "
" MS-DOS hard disk. "
"This means you must use the FDISK and FORMAT commands "
"provided by MS-DOS to partition and format the hard disk. "
"(Consult your MS-DOS manual about the use of these commands.) "
"Failure to heed this warning may cause unpredictable results."
)
(message "Hard drive configuration could not be completed.")
)
)
)
;Delete the temporary directory created by this script
(delete "ram:CrossDOSTemp")
)
)
;********************** Product Registration **************************
(procedure Register
(
(run
(cat @execute-dir
(cat "c/Registration "
(cat @execute-dir "RegistrationInfo")
)
)
)
)
)
;***************************************************************************
;***************************** MAIN ****************************************
;***************************************************************************
;Force user level to 1 or 2. This is unfortuntely required because otherwise
;we can't present a menu of choices to the user.
(if
(= @user-level 0)
(
(user 1)
(set @user-level 0)
)
)
;Disallow pretend mode
(if @pretend
(
(message "Sorry, you can't run the installation in "
"\"pretend\" mode. Exiting..."
)
(exit
(quiet)
)
)
)
;Test whether we can access :l/CrossDOSFileSystem. If not, the user is
;not running from the product disk - abort.
(if
(not
(exists ":l/CrossDOSFileSystem")
)
(
(message "You must run the installation program from the "
"CrossDOS disk. Exiting..."
)
(exit
(quiet)
)
)
)
;Initialize certain variables
(set pcdir "")
(set harddisk "")
(set disklabel
(expandpath ":")
)
(set @execute-dir disklabel)
;get Kickstart version number
(set ksver
(/
(getversion "exec.library"
(resident)
)
65536
)
)
;set ks20 variable to 1 if running Kickstart 2.04 or above
(set ks20
(> ksver 36)
)
;get Workbench version number
(set wbver
(/
(getversion "version.library"
(resident)
)
65536
)
)
;set wb21 variable to 1 if running Workbench 2.1 or above
(set wb21
(> wbver 37)
)
;Check to see whether the user has a c:CDMount. If so, set "prefix"
;to "CD".
(if
(exists "c:CDMount")
(set prefix "CD")
)
;Check whether the disk label is "CrossDOS_Plus:"; if not, try to relabel the
;disk.
;The rename (relabel in this case) command doesn't seem to work...another
;installer bug?
;(if
; (not
; (= disklabel "CrossDOS_Plus:")
; )
; (
; (rename
; (disklabel)
; ("CrossDOS_Plus")
; (disk)
; )
; )
;)
(while 1
(
;Attempt to determine what the default menu options should be
(set defmenu 0)
(if
(not
(exists "l:CrossDOSFileSystem")
)
(set defmenu
(bitor defmenu 9)
)
)
(if
(and
(not
(exists "sys:CrossPC")
)
(exists ":CrossPC")
)
(set defmenu
(bitor defmenu 10)
)
)
;Ask the user what he wants to install or do.
(set mainopt
(askoptions
(prompt "Please select all functions that you wish to perform")
(choices "Install CrossDOS"
"Install CrossPC"
"Configure MS-DOS Hard Disk for CrossDOS & CrossPC"
"Fill out Product Registration"
"Uninstall CrossDOS"
)
(default defmenu)
(help "The \"Install CrossDOS\" and \"Install CrossPC\" options install the "
"software. The \"Configure MS-DOS Hard Disk\" option will run ConfigDisk, "
"which allows you to set up a drive or partition for CrossPC and "
"CrossDOS. The \"Fill out Product Registration\" option will "
"prompt you for your name and address, and print it to PRT: (the "
"default printer). Using the registration software eliminates "
"the difficulties we sometimes have reading hand-written registration cards. "
"Use the \"Uninstall CrossDOS\" option to remove CrossDOS."
)
)
)
(if
(= mainopt 0)
(
(message "You didn\'t select anything. Exiting...")
(exit
(quiet)
)
)
)
(if
(or
(not
(in mainopt 4)
)
(= mainopt 16)
)
(
(if
(in mainopt 0)
(
(InstallCrossDOS)
;Check to see whether the user has a c:CDMount. If so, set "prefix"
;to "CD".
(if
(exists "c:CDMount")
(set prefix "CD")
)
)
)
(if
(in mainopt 1)
(InstallCrossPC)
)
(if
(in mainopt 2)
(ConfigureHardDisk)
)
(if
(in mainopt 3)
(Register)
)
(if
(in mainopt 4)
(UninstallCrossDOS)
)
(exit
(quiet)
)
)
(
(message "The uninstall option cannot be selected in conjunction "
"with any other options. Perhaps you accidentally "
"selected it."
)
)
)
)
)